package com.lk.satokendemo.mapper;

import com.lk.satokendemo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserMapper {

    @Select("select * from user where username=#{username} and password = #{password}")
    User Login(User user);

    @Insert("insert into user values (0,#{username},#{password})")
    Integer Register(User user);

    @Select("select level from user where  id = #{id}")
    Integer selectLevel(Integer id);

}
